package com.idroc.coelacanth.core.message;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.handler.codec.frame.FrameDecoder;

/**
 * 消息解码器
 * @author yuyoo (yuyoo4j@163.com)
 * @date 2009-12-4 上午11:41:32
 */
@ChannelPipelineCoverage("all")
public class MessageDecoder extends FrameDecoder {
	
	// private static final Logger log = LoggerFactory.getLogger(MessageDecoder.class);

	@Override
	protected Object decode(ChannelHandlerContext channelhandlercontext,
			Channel channel, ChannelBuffer channelbuffer) throws Exception {
		 
		Message msg = AbstractMessage.decodeMessage(channelbuffer);
		return msg;
	}

	@Override
	protected Object decodeLast(ChannelHandlerContext ctx, Channel channel,
			ChannelBuffer buffer) throws Exception {
		 
		return null;
	}

	
}
